//
//  Passenger.m
//  College Demo
//
//  Created by mashujun on 2022/7/18.
//

#import "Passenger.h"


@implementation Orders
- (void)initOrder:(Address *) Destination{
   if(self=[super init]){
    [self createOrderWithAddress:Destiantion];
   }
   return self;
}
- (void)createOrderByAddress:(Address *) Destination{
   self.Destination=Destiantion;
}
@end

@implementation Passenger
- (void) init :(Bool) AgeRange : (NSString *)name address:(Address *)address birthday:(nonnull NSDate *)birthday:(NSMutableArray *) HistoryOrder: (NSMutableArray *) WaitingOrder{
   if(self=[super init]){
      [self createPersonWithName:name ddress:address birthday:birthday];
      self.AgeRange=AgeRange;
      self.HistoryOrder=HistoryOrder;
      self.WaitingOrder=WaitingOrder;
   }
   return self;
}

- (void) bookTicket: :(Address *)Destination{
   Orders *order1 =[[orders alloc]init];
   [HistoryOrder.addObject =@order1]; 
   [WaitingOrder.addObject =@order1]; 
   
}
- (void) checkTicket :(Orders *)Orders{
   [WaitingOrder.removeObject :@order1]; 
}
   
@end
